﻿<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/static/common/taglibs.jsp"%>
<div class="page">
	<div class="pageContent">
		<form method="post" action="${ctx}${baseMapping}/save"
			class="pageForm required-validate"
			onsubmit="return validateCallback(this, dialogAjaxDone)">
			<input type="hidden" name="id" value="${role.id}" />
			<div class="pageFormContent" layoutH="68">
				<fieldset>
					<legend>编辑角色信息</legend>
					<div class="control-group">
						<label class="control-label" for="name">角色名:</label>
						<div class="controls">
							<input type="text" class="required" id="name" name="name" value="${role.name }">
						</div>
					</div>
				</fieldset>
				<fieldset>
					<legend>权限</legend>
					<table class="list">
						<thead>
							<tr>
								<th width="90px">权限组</th>
								<th>权限</th>
							</tr>
						</thead>
						<tbody id="aus">
							<c:forEach items="${permissionListByType}" var="perType">
								<tr>
									<td>${perType.key}</td>
									<td><c:forEach items="${perType.value}" var="per">
											<label>${per.displayName}<input type="checkbox"
												id="permissions" name="permissions" value="${per.value}"
												<c:if test="${fn:contains(checkedPermission,per.value)}"> checked </c:if>
												class="required" />
											</label>

										</c:forEach></td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</fieldset>
			</div>
			<div class="formBar">
				<shiro:hasPermission name="department:edit">
					<ul>
						<li><div class="buttonActive">
								<div class="buttonContent">
									<button type="submit" id="btn" class="btn">提交</button>
								</div>
							</div></li>
						<li><div class="button">
								<div class="buttonContent">
									<button type="button" class="close">取消</button>
								</div>
							</div></li>
					</ul>
				</shiro:hasPermission>
			</div>
		</form>
	</div>
</div>
